package chapter04.d2_robust.demo2;

public class Operation {
    public String generateAddOperation(int leftNum, int rightNum) throws RuntimeException {
        assert 0 <= leftNum && leftNum <= 100 : "左运算数不在0-100的范围之间";
        assert 0 <= rightNum && rightNum <= 100 : "右运算数不在0-100的范围之间";
        int value = leftNum + rightNum;
        assert 0 <= value && value <= 100 : "运算结果大于100";
        return leftNum + "+" + rightNum + "=" + value;
    }
}
